package com.foreknow.elm.controller;

import com.foreknow.elm.po.Business;
import com.foreknow.elm.service.impl.BusinessServiceImpl;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

public class BusinessController {
    public Object listBusinessByOrderTypeId(HttpServletRequest request){
        //获取前台请求参数 /BusinessController/listBusinessByOrderTypeId?orderTypeId=1
        Integer orderTypeId = Integer.parseInt(request.getParameter("orderTypeId"));
        BusinessServiceImpl businessService = new BusinessServiceImpl();
        List<Business> list = businessService.listBusinessOrderTypeId(orderTypeId);
        return list;
    }
    public Object getBusinessById(HttpServletRequest request){
        //获取前台请求参数 /BusinessController/getBusinessById?businessId=10001
        BusinessServiceImpl businessService = new BusinessServiceImpl();
        Integer businessId = Integer.parseInt(request.getParameter("businessId"));
        Business business = businessService.getBusinessById(businessId);
        return business;
    }
}
